//
//  AboutUsViewController.m
//  HMPersonalDoctor
//
//  Created by manman on 16/9/10.
//  Copyright © 2016年 geduo. All rights reserved.
//

#import "AboutUsViewController.h"
#import "Masonry.h"
#import "UserDelegateController.h"
@interface AboutUsViewController ()

@end

@implementation AboutUsViewController
- (instancetype)init
{
if(self = [super init])
{
    [self setupUI];

}

    return self;

}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"关于我们";
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)setupUI
{
    self.view.backgroundColor = [UIColor whiteColor];
//添加子控件
    UIImageView *picture = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"product_img_logo_nor.png"]];
    [picture sizeToFit];
    [self.view addSubview:picture];
    
    [picture mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(150);
        make.centerX.equalTo(self.view);
    }];
    
    UIImageView *words = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"product_text_logo_nor.png"]];
    [words sizeToFit];
    [self.view addSubview:words];
    [words mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(picture.mas_bottom);
        make.left.equalTo(picture);
    }];
    
    
    UIButton *btn = [[UIButton alloc]init];
//    btn.backgroundColor = [UIColor magentaColor];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(words.mas_bottom).offset(100);
        make.width.equalTo(self.view.mas_width);
        make.height.mas_equalTo(20);
    }];
    [btn addTarget:self action:@selector(clickBtn) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    
    UIImageView *imageV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"product_img_icon_xieyi.png"]];
    [imageV sizeToFit];
    [btn addSubview:imageV];
    [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(btn.mas_left).offset(10);
        make.top.equalTo(btn).offset(3);
    }];
//    [self.view addSubview:middle];
    
    UILabel *label = [[UILabel alloc]init];
    label.text = @"用户协议";
//    label.backgroundColor = [UIColor redColor];
    label.textColor = [UIColor blackColor];
    label.font = [UIFont systemFontOfSize:17];
    [label sizeToFit];
    [btn addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(btn.mas_top);
        make.left.equalTo(imageV.mas_right).offset(10);
        make.width.mas_equalTo(80);
        make.height.equalTo(btn.mas_height);
    }];
    
    UIImageView *right = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"product_button_input_jianjiao.png"]];
    [right sizeToFit];
    [btn addSubview:right];
    [right mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(btn.mas_right).offset(-10);
        make.top.equalTo(btn).offset(3);
    }];


    UILabel *phone = [[UILabel alloc]init];
    phone.text = @"用户交流群:44876827494";
    phone.textColor = [UIColor darkGrayColor];
    phone.font = [UIFont systemFontOfSize:15];
    [phone sizeToFit];
    [self.view addSubview:phone];
    [phone mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-80);
        make.centerX.equalTo(self.view);
    }];
    
    UILabel *num = [[UILabel alloc]init];
    num.text = @"Version 1.5.8";
    num.textColor = [UIColor colorWithRed:60 / 255.0 green:192 / 255.0 blue:198 / 255.0 alpha:0.7];
    num.font = [UIFont systemFontOfSize:13];
    [num sizeToFit];
    [self.view addSubview:num];
    [num mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-30);
        make.centerX.equalTo(self.view);
    }];


}
- (void)clickBtn
{
    UserDelegateController *uesr = [[UserDelegateController alloc]init];
    [self.navigationController pushViewController:uesr animated:YES];



}

@end
